<?php
/**
 * Created by PhpStorm.
 * User: qingyun
 * Date: 17/12/23
 * Time: 下午2:33
 */

namespace app\home\model;


class add
{
    function saveData($d){
        if(!Db('comment')->insert($d)) return ['status'=>-1,'msg'=>'商品添加失败！'];
        return ['status'=>1,'msg'=>'商品已添加！'];
    }
    function saveStar($data){
        $where['id']=$data['lasr_id'];
        $data['comment']=$data['star'];
        if(!Db('comment')->where($where)->update($data)) return ['status'=>-1,'msg'=>'星星添加失败！'];
        return ['status'=>1,'msg'=>'星星已添加！'];
    }
}